{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对全体数据，随机选择其中80%做训练数据，剩下20%为测试数据，评价指标为RMSE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from IPython.display import display, HTML\n",
    "from sklearn.linear_model import LinearRegression, RidgeCV, LassoCV, ElasticNetCV #模型\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_train: (584, 34)\n",
      "X_test: (147, 34)\n"
     ]
    }
   ],
   "source": [
    "data=pd.read_csv(\"FE_day.csv\")\n",
    "y=data[\"cnt\"]\n",
    "X=data.drop('cnt',axis=1)\n",
    "X_train,X_test,y_train,y_test= train_test_split(X,y,test_size=0.2,random_state=0)\n",
    "\n",
    "print(\"X_train:\",X_train.shape)\n",
    "print(\"X_test:\",X_test.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用训练数据训练最小二乘线性回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>mnth_6</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_4</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>yr</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.344785</td>\n",
       "      <td>0.322133</td>\n",
       "      <td>0.859897</td>\n",
       "      <td>0.421794</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>503</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.629300</td>\n",
       "      <td>0.619631</td>\n",
       "      <td>0.538132</td>\n",
       "      <td>0.235894</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>642</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.745598</td>\n",
       "      <td>0.694260</td>\n",
       "      <td>0.743359</td>\n",
       "      <td>0.196166</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>498</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.689526</td>\n",
       "      <td>0.664414</td>\n",
       "      <td>0.592545</td>\n",
       "      <td>0.417929</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>303</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.349977</td>\n",
       "      <td>0.363591</td>\n",
       "      <td>0.723222</td>\n",
       "      <td>0.173084</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  mnth_4  \\\n",
       "97          0         1         0         0       0       0       0       1   \n",
       "503         0         1         0         0       0       0       0       0   \n",
       "642         0         0         0         1       0       0       0       0   \n",
       "498         0         1         0         0       0       0       0       0   \n",
       "303         0         0         0         1       0       0       0       0   \n",
       "\n",
       "     mnth_5  mnth_6 ...  weekday_4  weekday_5  weekday_6      temp     atemp  \\\n",
       "97        0       0 ...          0          1          0  0.344785  0.322133   \n",
       "503       1       0 ...          0          1          0  0.629300  0.619631   \n",
       "642       0       0 ...          1          0          0  0.745598  0.694260   \n",
       "498       1       0 ...          0          0          0  0.689526  0.664414   \n",
       "303       0       0 ...          0          0          0  0.349977  0.363591   \n",
       "\n",
       "          hum  windspeed  holiday  workingday  yr  \n",
       "97   0.859897   0.421794        0           1   0  \n",
       "503  0.538132   0.235894        0           1   1  \n",
       "642  0.743359   0.196166        0           1   1  \n",
       "498  0.592545   0.417929        0           0   1  \n",
       "303  0.723222   0.173084        0           1   0  \n",
       "\n",
       "[5 rows x 33 columns]"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "\n",
    "\n",
    "#保存特征名字以备后用（可视化）\n",
    "feat_names = X_train.columns\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1* Linear Regression without regularization 最小二乘线性回归 最小二乘没有超参数需要调优，直接用全体训练数据训练模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RMSE on training set 753.7385497437841\n",
      "RMSE on Test set 781.895294589167\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.metrics import r2_score\n",
    "#调用线性规划包\n",
    "model=LinearRegression()\n",
    "#调用线性回归包\n",
    "model.fit(X_train,y_train)\n",
    "#训练数据的预测值\n",
    "y_pre_train=model.predict(X_train)\n",
    "y_pre_test=model.predict(X_test)\n",
    "#使用RMSE进行评估\n",
    "mse=mean_squared_error\n",
    "#训练值评估\n",
    "rmse_train=np.sqrt(mse(y_train,y_pre_train))\n",
    "#预测值评估\n",
    "rmse_test=np.sqrt(mse(y_test,y_pre_test))\n",
    "print(\"RMSE on training set\",rmse_train)\n",
    "print(\"RMSE on Test set\",rmse_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(33,)"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#特征数，最小二乘模型系数数量\n",
    "model.coef_.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEVCAYAAABE7SrmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xm8HFWd/vHPQ1gFJAgZZQlEWQTZJciiYFgEF0AdYVAYTUB0UBnGUcCMMBJQ5gcyAjPIjiCb7IKRHcRAQAgQCAkRCGFNBNkEJMOiwPf3xzlNms69fbv79u2q7jzv16tf9HKq6tS9ob+3qk49RxGBmZlZmSxSdAfMzMxquTiZmVnpuDiZmVnpuDiZmVnpuDiZmVnpuDiZmVnpuDhZT5L0YUn3SnpF0gGSlpL0W0kvS7pE0l6Srm9gPT+UdEYn+lynD6tJmidpWJvWN0HSee1YVy9o5uchaZKkfYe6T+biZAWTtKeku/OX79OSrpH0iTas+mBgUkQsGxH/C+wGvB9YISJ2j4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rsLWF7SiPx6O6CpWX+drWdmZu/oK3AXuAk4GViJNPPthRFxhKTNgMuB5YHXgT9HxHp5PZ8CfkaaY2wq8M08O3Nj/XBxMjOzsvFpPTMzKx0XJzMzKx0XJzMzKx0XJzMzKx0XJzMzKx0XJzMzKx0XJzMzK53/D/5OGFDUdQPtAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "import matplotlib.pyplot as plt\n",
    "# Plot important coefficients\n",
    "coefs=pd.Series(model.coef_,index=feat_names)\n",
    "#正系数最大的10个特征和负系数最小的十个特征\n",
    "imp_coefs=pd.concat([coefs.sort_values().head(10),coefs.sort_values().tail(10)])\n",
    "imp_coefs.plot(kind = \"barh\")\n",
    "plt.title(\"Coefficients in the OLS Model\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "season_1        1.473789e+15\n",
       "season_2        1.473789e+15\n",
       "season_3        1.473789e+15\n",
       "season_4        1.473789e+15\n",
       "mnth_1          2.132010e+16\n",
       "mnth_2          2.132010e+16\n",
       "mnth_3          2.132010e+16\n",
       "mnth_4          2.132010e+16\n",
       "mnth_5          2.132010e+16\n",
       "mnth_6          2.132010e+16\n",
       "mnth_7          2.132010e+16\n",
       "mnth_8          2.132010e+16\n",
       "mnth_9          2.132010e+16\n",
       "mnth_10         2.132010e+16\n",
       "mnth_11         2.132010e+16\n",
       "mnth_12         2.132010e+16\n",
       "weathersit_1   -9.838053e+15\n",
       "weathersit_2   -9.838053e+15\n",
       "weathersit_3   -9.838053e+15\n",
       "weekday_0      -3.293197e+14\n",
       "weekday_1      -3.014744e+16\n",
       "weekday_2      -3.014744e+16\n",
       "weekday_3      -3.014744e+16\n",
       "weekday_4      -3.014744e+16\n",
       "weekday_5      -3.014744e+16\n",
       "weekday_6      -3.293197e+14\n",
       "temp            2.872125e+03\n",
       "atemp           9.467500e+02\n",
       "hum            -1.861844e+03\n",
       "windspeed      -1.510391e+03\n",
       "holiday         2.981812e+16\n",
       "workingday      2.981812e+16\n",
       "yr              1.957691e+03\n",
       "dtype: float64"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "coefs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "系数的值非常大。由于特征之间强相关，OLS模型的性能并不好"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2* Linear Regression with Ridge regularization (L2 penalty"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best_alpha: 1.0\n",
      "cv of rmse : [ 804.98946948  801.06246694  797.95313648  822.15888399 1078.04194503\n",
      " 1680.07803178]\n",
      "RMSE on Training set : 754.0366623762044\n",
      "RMSE on Test set : 776.9753607134354\n"
     ]
    }
   ],
   "source": [
    "#RidgeCV缺省的score是mean squared errors \n",
    "# 1. 设置超参数搜索范围，生成学习器实例\n",
    "alphas=[0.01,0.1,1,10,100,1000]\n",
    "ridge=RidgeCV(alphas=alphas,store_cv_values=True)\n",
    "# 2. 用训练数据度模型进行训练\n",
    "# RidgeCV采用的是广义交叉验证（Generalized Cross-Validation），留一交叉验证（N-折交叉验证）的一种有效实现方式\n",
    "ridge.fit(X_train,y_train)\n",
    "#通过交叉验证得到最佳alpha\n",
    "best_alpha=ridge.alpha_\n",
    "print(\"best_alpha:\",best_alpha)\n",
    "# 交叉验证估计的测试误差\n",
    "mse_cv = np.mean(ridge.cv_values_, axis = 0)\n",
    "rmse_cv = np.sqrt(mse_cv)\n",
    "print(\"cv of rmse :\",rmse_cv)\n",
    "y_train_pred = ridge.predict(X_train)\n",
    "rmse_train = np.sqrt(mean_squared_error(y_train,y_train_pred))\n",
    "\n",
    "y_test_pred = ridge.predict(X_test)\n",
    "rmse_test = np.sqrt(mean_squared_error(y_test,y_test_pred))\n",
    "\n",
    "print(\"RMSE on Training set :\", rmse_train)\n",
    "print(\"RMSE on Test set :\" ,rmse_test)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ridge picked 33 features and eliminated the other 0 features\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEICAYAAAD7pTujAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xu8lVWdx/HPN/OOSQqZd/IWqSgKXhilQSUttdTS8TYp1thYOdar8ZY6xoxZlt0sM1Mzb4yZpqZpImkIIiKgwIG8C44kqXjLSsnkN3+sdeRhu/c5e5/Lvpzzfb9e58Wz17Oe9fz2ZnMWaz3r+T2KCMzMzJrJuxodgJmZWSl3TmZm1nTcOZmZWdNx52RmZk3HnZOZmTUdd05mZtZ03DlZS5P0QUkPSXpN0kmS1pR0q6RXJV0v6WhJd1bRzhmSLqtHzB3EsJmkv0hapYfaGy/pmp5oq4pzdfg5S5os6d/qEUtPqCVeSSFpq96Oqb9x52R1IekoSbPyL98lkn4rac8eaPpUYHJErBMRPwQOBTYA1o+IwyJiQkTs21kjEfGNiOj2L09JQ/Ivq3fXemxE/F9EDIiIt7pw3jGSFtd6XA3tXyHp7/nv7yVJkyQNbd9f7efcC3GNz5/3SSXlX87l4+sdk/UMd07W6yR9BfgB8A1Sx7EZcBFwUA80vzmwoOT1YxHxjx5o21b27YgYAGwM/BH4WYPjafcYcGxJ2TG53FqUOyfrVZLWBf4H+GJE3BgRf42INyPi1og4JddZXdIPJD2bf34gafVCGwdKmiPpFUn3Sdohl98N7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Nm8/ZykDSNiSR4uP1+veHNcm1aIq1z5UtKw/t159FSs32XVxi7pUuA3+WWtsddbR/E1VEQ8m/98XtJNpCmlSt/DZnkftca3GBhTUj65DnECEBHPtW832/dW0qqkjmlCRNyYi+v2+XparwEkDZa0St7eAtgaeCoPk1+TtHu+bnMM0D6auQVoX+lybKG8Hm4BjpC0uqQP5HgfAGYCWyutzFsNOAK4JV8v+z0rHu7Y6/GWXN84BGhfEVVT7L0ZYwXNEsdKJK0taZ32bWBf0mda6Xt4C3BMXrW1O/Bq+/RPndUa30RgX0nvzVNq++ayumjW723+/fMz4OGI+F5hV/0+355e5eGflVa8HEL6n8My4DlgYi7/FLCAtNLmQeDjhWNGkr6gTwIXsiKLx/rAXcDj+c/16hVv3ndmjulR8grCWLFK57G878xC+Rakf0xPANcDq/fyZ3010AbMy/9QNuxq7A34njRFHCUxbZG/n3Pzd/XMjr6HpOmbH+f30EZhtWcvxngtaYr8zfy9/WxX4iNNoz2Rf46rc7xN+b0F9iRNv80D5uSf/ev5+Tp9kZmZNR1P65mZWdNx52RmZk3HnZOZmTUdd05mZtZ03DmZmVnTcedkZmZNx52TmZk1nf8H+EqVcDLn5I8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot important coefficients\n",
    "coefs = pd.Series(ridge.coef_, index = feat_names)\n",
    "print(\"Ridge picked \" + str(sum(coefs != 0)) + \" features and eliminated the other \" +  \\\n",
    "      str(sum(coefs == 0)) + \" features\")\n",
    "\n",
    "#正系数值最大的10个特征和负系数值最小（绝对值大）的10个特征\n",
    "imp_coefs = pd.concat([coefs.sort_values().head(10),\n",
    "                     coefs.sort_values().tail(10)])\n",
    "imp_coefs.plot(kind = \"barh\")\n",
    "plt.title(\"Coefficients in the Ridge Model\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs":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K0p6Kiwmtra6MuQ0Sky462xPnY917lolGDePjzl/bq2Ga23N0rOuqXftdmIiLSI15+cxvb9zel5YSEJIWQiEiWqqqOMXJQMVece0bUpbRLISQikoXe23GQP9ftYGZlOfl5bf12SnpQCImIZKH5NTHy8yxtJyQkKYRERLJMU3MLC2vrufb84QwfWBx1OSelEBIRyTIvrn2f3YeOptUjG9qjEBIRyTJV1THOOr0vl509LOpSOqQQEhHJIhu37afm3V3MqiwnL40nJCQphEREskhVdYzCfGPGJaVRl9IpCiERkSzxwZEWnlzRwHXjR3B6/6Koy+kUhZCISJZ4dvUW9h9uTusVElpTCImIZIl51THGntGfyjFDoy6l0xRCIiJZYO3mvayq38PsynIST9LJDAohEZEsMK8mRlFBHrdMzowJCUkKIRGRDHegqZmnV27mhotHMqhvYdTldIlCSEQkwz29ajMHj7Rk1ISEJIWQiEgGc3d+uzTG+SMGMrFscNTldJlCSEQkg62q38P6rfuYMyWzJiQkKYRERDJYVXWMfn3yuWnSqKhL6RaFkIhIhtp76CjPvrGF6ZNG0b+oIOpyukUhJCKSoRatbKCpOc7sysybkJCkEBIRyUDuTlV1jIvLBjN+1KCoy+k2hZCISAaqeXcXdY0HMnJadiqFkIhIBqqqjjGguIAbJoyMupRTohASEckwOw808eLa97llcimn9cmPupxTohASEckwTyxv4EhLPONvxYFCSEQko8TjzryaGJWjhzJu+ICoyzllCiERkQzyl7/vYNPOQ8yZmvlXQaAQEhHJKFVLYwzt14dp48+MupQeoRASEckQ2/YdZvH6bdx6SSlFBZk9ISFJISQikiEWLqunJe7MyuAVElpTCImIZICWuDO/JsblY4cxZli/qMvpMQohEZEM8McNjWzZezgrpmWnUgiJiGSAedUxSgYUcc0Fw6MupUcphERE0lzD7kO8uqGR2yrKKMzPrr+2s+vTiIhkoceW1QMws7Is4kp6XmghZGZlZrbEzNab2TozuydoH2pmi81sY/BzSNBuZvagmdWZ2Wozm5xyrrlB/41mNjel/RIzWxMc86AFz7btzhgiIunoaEucBcvqufLcMygd0j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D9sfdPQ68b2ZLUo4ZAWxPef8ZM7uTxH+zI0g8RG91q3HiwGPB9m+B1MU2k9vLSQQfJJ4T8zMzmwi0AOek9G8ERnbxc4p0mUJIJHxtPfLhZO0AHwDFAGY2BvgacKm77zazR5L7OpC6JldT8LOFD/+7/8/ANhJXaHnA4ZT+xUENIqHS7TiR8L0G3BY8KKwE+AegBvgzcEvw3dBw4IqUY9YDY4PtgcBBYG/LECQ/AAAA9klEQVTQ77p2xskDkt8pzQ7OfzKDgK3BldhngfyUfecQ0tL9Iql0JSQSvqdIfN/zBomrk//m7u+b2ZPA1ST+sn+bxBM79wbH/J5EKL3s7m+Y2UpgHfAO8Jd2xjkIXGhmy4Pz3NZBXb8AnjSzGcCS4PikK4MaREKlVbRFImRm/d39gJmdTuLq6LIgoE4jEQyXBd8ldeZcB9y9fw/V9Row3d1398T5RNqjKyGRaD0XPECsD/Bdd38fwN0/MLMHgFFArDcLCm4Z/kgBJL1BV0IiIhIZTUwQEZHIKIRERCQyCiEREYmMQkhERCKjEBIRkcgohEREJDL/Hy8jKKtlNBs/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mse_mean = np.mean(ridge.cv_values_, axis = 0)\n",
    "plt.plot(np.log10(alphas), mse_mean.reshape(len(alphas),1)) \n",
    "\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上图可以看出alpha等于1的时候，mse值最小，取到最优值alpha，相比OLS，岭回归模型增加了L2正则，系数值进行了收缩。 由于增加正则限制了模型复杂的，相比比OLS模型，岭回归模型在训练集上的误差略有增大，但在测试集上的误差有所减小"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3* Linear Regression with Lasso regularization (L1 penalty)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best_alpha 2.336453166053944\n",
      "cv of rmse : 828.555046050678\n",
      "mse on training is set 754.2656275844785\n",
      "mse on Test is set 786.6230585764281\n",
      "Lasso picked 27 features and eliminated the other 6 features\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEICAYAAAD7pTujAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XuYHFWd//H3R+6QSLhEBLlECBiBYCDDTYgbIIIiiq7wcFslyMoiIutPBbLAYhRZQRRERBEQuWURQVAQNEQwJEAIJJCr3AlsIggJEi4KEcj398c5TSpD90zPTE9fZj6v5+kn3adOVZ2qyfR36tSp71FEYGZm1kze1egGmJmZtefgZGZmTcfByczMmo6Dk5mZNR0HJzMzazoOTmZm1nQcnKylSfqApAclvSLpBElrSbpZ0kuSrpN0hKTbqtjOKZIurUebO2jD5pJelbRKjbY3XtLVtdhWfyPpKUljqqg3RFJIWrUe7epPHJysLiQdLmlG/vJ9VtLvJe1Zg02fBEyOiIER8SPgIGAjYIOIODgiJkTEvp1tJCL+JyL+vaeN6cmXVUT8X0QMiIi3urHf0ZIWdXW9Lmz/cknf6a3td1duV0j6VLvyH+bysQ1qmvWQg5P1OklfA34I/A8pcGwO/AQ4sAab3wKY3+7zoxHxZg22ba3hUeDI0of8h8HBwBMNa5H1mIOT9SpJ6wLfBr4cETdExN8j4o2IuDkiTsx11sh/6T6TXz+UtEZhGwdImiVpqaR7JO2Qy+8A9gJ+nK/IrgFOBw7Jn4+WNFbSXYVtbSdpkqS/SXpO0im5fKUuMEm75X0tlTRb0ujCssmSzpB0d+5OvE3ShnnxlPzv0tyG3SUNlXRn7mpcI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+LiDHdWG0RsFnh86bAM/l9ufIlpC6NVfNfTcX6ra6jc9GXPSdp44h4NndVPZ/LK52PRcDoduWT69DOmpK0GikwTYiIG3JxvzwXJRGxVNJk0j2nSr/npXOxSNKqwLqkruIe/f64W8/auwk4NI/AeT+wNWmixvuBrfOIndVJNz5vinTn80+smMjxSKDSVVmrKXvMDW5TPdxE+jnCyj/Pm4DP55FquwEv5a6uicC+ktbLo9n2zWUtI98j+TnwUEScW1jUH8/F4HzFhKS1gDGke3CVfs+L5+gg4I78vVDpu6Q6jR4Z4ldjXsBnSH/ZLAOeAyYWlp1K6mN+BPh4oXx/0iimJ0hdg6XyLfN/useB64A1Gn18NTxPZY+5r7yAa4BngTfy/4ejSfcLbgcey/+un+sKuDCfi7msPMrzC/nn/zhwVKOPqxvnYU9Sl9McYFZ+7d9Pz8UOwIP5XMwDTs/lZX/PgTXz58fz8i0L2yr7XVLNy+mLzMys6bhbz8zMmo6Dk5mZNR0HJzMzazoOTmZm1nQcnMzMrOk4OJmZWdNxcDIzs6bz/wHC94ttzuTI8AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#lasso#1. 生成学习器实例，LassoCV默认参数可自动确定alpha的搜素范围\n",
    "lasso=LassoCV()\n",
    "lasso.fit(X_train,y_train)\n",
    "#最优alpha\n",
    "best_alpha=lasso.alpha_\n",
    "print(\"best_alpha\",best_alpha)\n",
    "\n",
    "#模型性能\n",
    "mse_cv = np.mean(lasso.mse_path_, axis = 1)\n",
    "rmse_cv = np.sqrt(mse_cv)\n",
    "print(\"cv of rmse :\",min(rmse_cv))\n",
    "\n",
    "#训练和测试误差\n",
    "y_pre_train=lasso.predict(X_train)\n",
    "mse_train=np.sqrt(mse(y_train,y_pre_train))\n",
    "\n",
    "y_pre_test=lasso.predict(X_test)\n",
    "mse_test=np.sqrt(mse(y_test,y_pre_test))\n",
    "\n",
    "print(\"mse on training is set\",mse_train)\n",
    "print(\"mse on Test is set\",mse_test)\n",
    "\n",
    "#特征重要性\n",
    "#Plot important coefficients\n",
    "coefs = pd.Series(lasso.coef_, index = feat_names)\n",
    "print(\"Lasso picked \" + str(sum(coefs != 0)) + \" features and eliminated the other \" +  \\\n",
    "      str(sum(coefs == 0)) + \" features\")\n",
    "imp_coefs = pd.concat([coefs.sort_values().head(10),\n",
    "                     coefs.sort_values().tail(10)])\n",
    "imp_coefs.plot(kind = \"barh\")\n",
    "plt.title(\"Coefficients in the Lasso Model\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaEAAAEKCAYAAAC7c+rvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt8VdWZ//HPkzsECJcECHcQioIoYkS8tKXaKmpbrKOtbcei4wy96K/t/NpftTPT2utM+5pWO05bO7ZatXVqrXYUq9ZBxVpbRcMd5BbugUACgUASyPX5/XFW8BATckBOds7J9/16bc8+a6+917M5eB722uusbe6OiIhIFDKiDkBERHovJSEREYmMkpCIiERGSUhERCKjJCQiIpFREhIRkcgoCYmISGSUhEREJDJKQiIiEpmsqAPo6QoLC33cuHFRhyEiklKWLFmy192LuqqnJNSFcePGUVpaGnUYIiIpxcy2JVJP3XEiIhIZJSEREYmMkpCIiERGSUhERCKjJCQiIpFREhIRkcgoCYmISGSUhERE5G1+9PwG/rppb9LbURISEZFjVB48wo+e30jp1v1Jb0tJSEREjvHcm3sAuOLM4UlvS0lIRESO8dzq3Uwoymfi0H5Jb0tJSEREjjpQ38irm/cxZ+pwzCzp7SUtCZlZnpm9bmYrzGyNmX0zlD9gZlv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IuoOuhEREJDIamCAiIpFREhIRkcgoCYmISGSUhEREJDJKQiIiEhklIRERicz/B5WQ16cl4/+KAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "plt.plot(np.log10(lasso.alphas_), mse_cv) \n",
    "\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "season_1        -991.864539\n",
       "season_2          -0.000000\n",
       "season_3           0.000000\n",
       "season_4         448.139977\n",
       "mnth_1          -152.357646\n",
       "mnth_2           -46.677131\n",
       "mnth_3           272.393334\n",
       "mnth_4            -0.000000\n",
       "mnth_5           364.227409\n",
       "mnth_6             0.000000\n",
       "mnth_7          -395.772042\n",
       "mnth_8            10.784305\n",
       "mnth_9           641.369561\n",
       "mnth_10          352.506349\n",
       "mnth_11         -209.768543\n",
       "mnth_12         -153.539040\n",
       "weathersit_1     388.138775\n",
       "weathersit_2      -0.000000\n",
       "weathersit_3   -1429.882687\n",
       "weekday_0       -273.619964\n",
       "weekday_1       -134.265169\n",
       "weekday_2        -22.758843\n",
       "weekday_3         -0.000000\n",
       "weekday_4         47.064979\n",
       "weekday_5         77.322211\n",
       "weekday_6         82.220008\n",
       "temp            2964.600668\n",
       "atemp            863.906434\n",
       "hum            -1618.968372\n",
       "windspeed      -1382.149139\n",
       "holiday         -301.586913\n",
       "workingday         1.389914\n",
       "yr              1941.529523\n",
       "dtype: float64"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "coefs\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Lasso模型增加了L1正则，系数值进行了收缩，同时有些特征的系数为0。 在这个例子中，岭回归模型比Lasso模型性能稍好"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pre_test=ridge.predict(X_test)\n",
    "df=pd.DataFrame({'cnt':y_test,'y_pre':y_pre_test})\n",
    "df.head()\n",
    "df.to_csv('submission.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 147 entries, 196 to 239\n",
      "Data columns (total 2 columns):\n",
      "cnt      147 non-null int64\n",
      "y_pre    147 non-null float64\n",
      "dtypes: float64(1), int64(1)\n",
      "memory usage: 3.4 KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cnt</th>\n",
       "      <th>y_pre</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>5923</td>\n",
       "      <td>4444.533866</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>4592</td>\n",
       "      <td>4714.102025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1248</td>\n",
       "      <td>1421.125422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>1360</td>\n",
       "      <td>1069.565993</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>390</th>\n",
       "      <td>4075</td>\n",
       "      <td>3651.848907</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>319</th>\n",
       "      <td>1817</td>\n",
       "      <td>1668.817376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>299</th>\n",
       "      <td>2659</td>\n",
       "      <td>3899.903336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>702</th>\n",
       "      <td>6234</td>\n",
       "      <td>5775.277635</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>462</th>\n",
       "      <td>6857</td>\n",
       "      <td>5962.638371</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1167</td>\n",
       "      <td>942.941863</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      cnt        y_pre\n",
       "196  5923  4444.533866\n",
       "187  4592  4714.102025\n",
       "14   1248  1421.125422\n",
       "31   1360  1069.565993\n",
       "390  4075  3651.848907\n",
       "319  1817  1668.817376\n",
       "299  2659  3899.903336\n",
       "702  6234  5775.277635\n",
       "462  6857  5962.638371\n",
       "27   1167   942.941863"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
